<div id="pandiv" style="background-color: ButtonFace;">
    <input type="text" jqxb-datasource="custCompactDetail" jqxb-datamember="Name" />
    <input type="text" jqxb-datasource="custCompactDetail" jqxb-datamember="Surname" /><br />
    <input type="button" value="CmdSaveCustomer" onclick="CustomerDetail.saveCustomer()"; />
</div>
<script type="text/javascript">
    /*
    *   jQXB - Dynamic-Widget logic
    *
    */
    var CustomerDetail = {}
    CustomerDetail.saveCustomer = function () {
        jQXB.saveJSON('SaveCustomer.php', jQXB.getDataSource('custCompactDetail'), function (data) { jQXBM.fireMessage(jQXBtopics.MSG_CUSTOMER_UPDATED, { id: data.id }, this) });
    }
    CustomerDetail.loadCustomer = function(id){
        jQXB.getJSON('getCustomer.php',{id:id},
                function(data){
                    jQXB.setDataSource('custCompactDetail',data).doBind('custCompactDetail');
                });
    }

    jQuery('body').ready(function () {
		alert("pandiv");
        jQXBM.subscribeMessage(jQXBtopics.MSG_CUSTOMER_SELECTED, CustomerDetail.loadCustomer);
    });
    


</script>